import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/layout'
import Login from '@/views/login'

import Dikede from '@/views/dikede'
const Checking = () => import('@/views/checking')
const Device = () => import('@/views/device')
const Goods = () => import('@/views/goods')
const Gssp = () => import('@/views/gssp')
const Order = () => import('@/views/order')
const Staff = () => import('@/views/staff')
const Workorder = () => import('@/views/workorder')

Vue.use(VueRouter)

const routes = [
  { path: '/login', component: Login },
  {
    path: '/',
    component: Layout,
    redirect: '/dikede',
    children: [
      { path: '/dikede', component: Dikede },
      { path: '/checking', component: Checking },
      { path: '/device', component: Device },
      { path: '/goods', component: Goods },
      { path: '/gssp', component: Gssp },
      { path: '/order', component: Order },
      { path: '/staff', component: Staff },
      { path: '/workorder', component: Workorder }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
